package com.da.lon.wang.xlg.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.da.lon.wang.xlg.R;
import com.da.lon.wang.xlg.constants.PreferencesConfig;
import com.da.lon.wang.xlg.constants.XLGConstants;
import com.da.lon.wang.xlg.util.PreferenceUtils;
import com.da.lon.wang.xlg.util.Utils;
import com.da.lon.wang.xlg.util.WebViewUtil;
import com.da.lon.wang.xlg.util.WebViewUtil.OnLoading;
import com.da.lon.wang.xlg.view.ScrollWebView;
import com.umeng.analytics.MobclickAgent;

public class ThreeFragment extends BaseFragment {

    private ScrollWebView webView;
    private WebViewUtil webViewUtil;
    private String product_number;
    private View view;

    public void onResume() {
        super.onResume();
        MobclickAgent.onPageStart("ThreeFragment");
        MobclickAgent.onResume(getActivity());
    }

    public void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd("ThreeFragment");
        MobclickAgent.onPause(getActivity());
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected View inflateView(LayoutInflater inflater, ViewGroup var2) {
        view = inflater.inflate(R.layout.ouka_three_fragment, null);
        return view;
    }

    @Override
    protected void initView() {
        product_number = PreferenceUtils.getInstance().getSettingStr(
                PreferencesConfig.PRODUCT_NUMBER, "");
        initView(view);

    }

    private void initView(View view) {
        webView = (ScrollWebView) view.findViewById(R.id.three_webview);

        webView.getSettings().setUseWideViewPort(true);
        webView.getSettings().setLoadWithOverviewMode(true);

        webViewUtil = new WebViewUtil(getActivity());
        webViewUtil.setWebView(
                Utils.constructUrl(XLGConstants.WEB_URL + "p/"
                        + product_number + ".html?viewtype=3&"), null,
                webView, 0);
        webViewUtil.setOnloadingListener(new OnLoading() {

            @Override
            public void onStart(String url) {
            }

            @Override
            public void onGetLocation(String url) {

            }

            @Override
            public void onError() {
            }

            @Override
            public void onComplete(String url) {
            }
        });

    }

    @Override
    protected void RefreshData() {
        // TODO Auto-generated method stub

    }

}
